package com.tjetc.dao;

import com.tjetc.domian.Maintenancerequest;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface MaintenancerequestMapper {
    int deleteByPrimaryKey(Integer requestid);

    int insert(Maintenancerequest record);

    int insertSelective(Maintenancerequest record);

    Maintenancerequest selectByPrimaryKey(Integer requestid);

    int updateByPrimaryKeySelective(Maintenancerequest record);

    int updateByPrimaryKey(Maintenancerequest record);

    @Select("select ResidentID,ApartmentID,RequestDate,RequestTime,Description,STATUS from maintenancerequest where " +
            "residentid= #{residentid}")
    List<Maintenancerequest> selectByRid(Integer residentid);

    @Select("select * from maintenancerequest where ResidentID=#{residentid} ")
    List<Maintenancerequest> select(int residentid);

    List<Maintenancerequest> selectAll();

    @Update("update maintenancerequest set Status= #{status} where RequestID= #{requestid}")
    int updateByrequestId(Maintenancerequest maintenancerequest);
}